<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var date1 = new Date();
    console.log(date1);

    var date2 = new Date(2021, 7, 14, 10, 30, 45);
    console.log(date2);

    var date3 = new Date('2021-08-15 10:30:45');
    console.log(date3);
  </script>
</body>
</html>